<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <title>Document</title>
</head>

<body>

  <script type="text/javascript">
    /*
    * Fetch响应结果的数据格式
    *
    */
    fetch('http://localhost:3000/json').then(function (data) {
      // return data.json(); JSON.parse()
      return data.text();
    }).then(function (data) {
      // console.log(data.uname)
      // console.log(typeof data)
      var obj = JSON.parse(data);
      console.log(obj.uname, obj.age, obj.gender)
    })
  </script>
</body>

</html>